package com.gkd.mapper;

import com.gkd.pojo.Storage;
import com.gkd.pojo.StoragePage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface StorageMapper {
    //根据id获得仓库
    Storage getByIdStorage(int id);

    //根据仓库名获得仓库
    Storage getByNameStorageOne(String name);
    //查询所有仓库
    List<Storage> getAllStorage();

    //分页查询
    List<Storage> getPageStorage(@Param("pageNum") int pageNum, @Param("pageSize") int pageSize);

    //新增仓库
    int addStorage(Storage storage);

    //根据id删除仓库
    int deleteStorage(int id);

    //修改仓库
    int updateStorage(Storage storage);

    //根据仓库名模糊查询仓库
    List<Storage> getByNameStorage(@Param("name") String name);

    //根据仓库名模糊查询仓库并分页
    List<StoragePage> getByNamePageStorage(@Param("name") String name, @Param("pageNum") int pageNum, @Param("pageSize") int pageSize);


}
